<?php
#Template for plan payment. 
$page = (isset($page)) ? $page : 'payment';
include "inc/local_data.php";
$form = (isset($using_real_env) && $using_real_env) ? $form : ((isset($data[$page])) ? $data[$page] : array());
if (empty($form)) exit;

?>
<!DOCTYPE html PUBLIC "-//WAPFORUM//DTD XHTML Mobile 1.2//EN" "http://www.openmobilealliance.org/tech/DTD/xhtml-mobile12.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
    <head>
        <title><?php echo $form['title'];?></title>
		<?php include('inc/embed_top.php');?>
    </head>
    <body mlang="<?php echo $form['lang'];?>" data-theme="f">
        <div id="pay" class="<?php echo $form['lang'];?> pay" data-role="page" data-theme="f">
            <div class="ltit"><span class="logo">&nbsp;</span><span class="r">tvb.com</span></div>
            <h1>
                <?php echo $form['payment_title'];?>
                <a ajax="<?php echo $form['button']['cancel']['link'];?>" class="cancel logout" href="#" rel="external" data-role="button"><?php echo $form['button']['cancel']['value'];?></a>                   
            </h1>
            <?php include('inc/inc.step.php');?>
	    	<div id="err-msg"></div>
            <form id="payForm" action="" ajax="<?php echo $form['ajax_url'];?>" success_url="<?php echo $form['success_url'];?>" restart_url="<?php echo $form['restart_url'];?>" method="<?php echo $form['method'];?>" >
                <?php

                    foreach((array)$form['hiddens'] as $key=>$val) {
                        echo '<input type="hidden" name="'.$key.'" value="'.$val.'" />';
                    }

                ?>
				<div class="grid card-type">
                    <div class="hd"><?php echo $form['payment_info']['payment_note'];?></div>
					<div class="bd" data-role="controlgroup" data-type="horizontal" data-role="fieldcontain">
						<input type="radio" name="card_type" id="card_type1" value="VISA" checked="checked" /><label for="card_type1">Visa</label>
						<input type="radio" name="card_type" id="card_type2" value="Master" /><label for="card_type2">Master</label>
					</div>
				</div>
	    		<div class="field">
                    <label for="s-card_owner"><?php echo $form['payment_info']['card_owner'];?></label>
	    			<input type="text" name="card_owner" id="s-card_owner" data-theme="f" />
	    		</div>
	    		<div class="field">
                    <label for="s-card_no"><?php echo $form['payment_info']['card_num'];?></label>
	    			<input type="text" name="card_no" id="s-card_no" value="" data-theme="f" />
	    		</div>
	    		<div class="field">
                    <label for="s-card_cvv"><?php echo $form['payment_info']['card_cvv'];?><em><?php echo
                            $form['payment_info']['card_cvv_note'];?></em></label>
	    			<input type="password" name="card_cvv" id="s-card_cvv" maxlength="3" data-theme="f" />
	    		</div>
	    		<div class="field expiry">
                    <label for="s-password"><?php echo $form['payment_info']['expiry_date'];?></label>
	    			<div class="ft">
					<select name="expiry_m" data-role="f">
                    <?php
                        echo '<option value="">'.$form['payment_info']['p_expiry_m'].'</option>';
                        for ($i=1; $i<13; $i++) {
                            $i = ($i<10) ? '0'.$i : $i;
    						echo '<option value="'.$i.'">'.$i.'</option>';
                        }
                    ?>
					</select>
					<select name="expiry_y">
                    <?php
                        echo '<option value="">'.$form['payment_info']['p_expiry_y'].'</option>';
                        $year = date('Y');
                        for ($i=2010; $i<=$year+10; $i++){
						    echo '<option value="'.$i.'">'.$i.'</option>';
                        }
                    ?>
					</select>
	    			</div>
	    		</div>
	    		
	    		<div class="agree">
                    <h2><?php echo $form['payment_info']['agreement'];?></h2>
                    <label for="s-agree" class="no-corner"><input type="checkbox" name="agree_term" id="s-agree" value="1" /><?php echo $form['payment_info']['agree_c'];?></label>
                    <a class="t ui-icon ui-icon-arrow-r" href="<?php echo $form['agree_ment_url'];?>" rel="external" target="_blank">&nbsp;</a>
	    		</div>
	    		<div class="chkcode field">
                    <label><?php echo $form['payment_info']['captcha'];?><em><?php echo $form['payment_info']['captcha_note'];?></em></label>
	    			<input type="text" class="" data-theme="f" name="captcha" />
		    	</div>
    			<div class="captcha">
                    <img id="captcha-img" width="200" height="50" src="./image.php?r=<?php echo $microtime;?>" />
    				<a href="javascript:void(0);" rel="external" id="reload-captcha-img">&nbsp;</a>
    			</div>
				<div class="cbtn ui-ubtn grid" data-inline="true">
                    <a href="<?php echo $form['button']['previous']['link'];?>" rel="external" data-role="button" class="prev hd"><?php echo $form['button']['previous']['value'];?></a>
					<div class="next bd ui-ubtn"><input type="submit" data-theme="f" value="<?php echo $form['button']['submit']['value'];?>" /></div>
				</div>
	    	</form>
            <form id="p2Form" action="<?php echo $form['action'];?>" method="<?php echo $form['method'];?>">
				<?php
					foreach($form['hidden'] as $name=>$item) {
						echo '<input type="hidden" name="'.$name.'" value="'.$item.'" />';
					}
				?>
	    	</form>
		</div>
		<?php include('inc/embed_bottom.php');?>
    </body>
</html>
